#ifndef WeekTable_H
#define WeekTable_H

#include <QWidget>
#include <QTableWidget>
#include "source/connection.h"

namespace Ui {
    class WeekTable;
}

class WeekTable : public QWidget
{
    Q_OBJECT

public:
    explicit WeekTable(QWidget *parent = 0);
    ~WeekTable();

    void LoadGroup(const QString grp);
    void LoadTeacher(const QString th);

    void LoadDay(int day, edu_class data);
    void LoadDayGroup(int day, edu_class data);
    void LoadDayMen(int day, edu_class data);
    void LoadDayRoom(int day, edu_class data);
    void AddRow(int count);

    void UpdateList();
    void UpdateListGroup();
    void UpdateListMen();
    void UpdateListRoom();

    QSqlQuery *OpenQuery(int day, edu_class data);
    QSqlQuery *OpenQueryGroup(int day, edu_class data);
    QSqlQuery *OpenQueryMen(int day, edu_class data);
    QSqlQuery *OpenQueryRoom(int day, edu_class data);

    QTableWidget *tblCur;
    int typeList;
    QDate dateList;
    QString selList;

private slots:
    void on_cbListView_currentIndexChanged(const QString &arg1);

    void on_dateEdit_dateChanged(const QDate &date);

    void on_TablesUpdate();

private:
    Ui::WeekTable *ui;
};

#endif // WeekTable_H
